var express = require('express');
var router = express.Router();
let {UserM,shop_list,cate} = require('../../modules/long')

router.get('/user',async(req,res)=>{
  let data = await UserM.find()
  res.send({
    code:200,
    data
  })
})
router.get('/shop_list',async(req,res)=>{
  let id= req.query._id
  console.log(id)
  let data = await shop_list.find({id:cate})
  console.log(data) 
  res.send({
    code:200,
    data,
  })
})
router.get('/cate',async(req,res)=>{
  let data = await cate.find()
  res.send({
    code:200,
    data,
    ht:'http://127.0.0.1:3000/chen/cate'
  })
})

module.exports = router;